Start Transaction
AutomatR.MySQLDataBase.Database.StartTransaction
The "Start Transaction" activity in AutomatR for MySQL databases is designed to initiate a database transaction, providing a way to group multiple database operations into a single unit of work. Transactions ensure data integrity by either committing all changes or rolling back to the previous state in case of an error.
Properties
Name | Description |
---|---|
Input | |
Connection | Specifies a MySqlConnection variable to establish a connection to the MySQL database. This variable is used to execute database operations within the transaction. MySqlConnection variables containing the necessary connection details. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Start Transaction" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
How to use:
- Drag and drop the "Start Transaction" activity onto the workflow.
- Configure the properties by specifying the MySqlConnection variable for the connection.
- Optionally, configure the delay for synchronization purposes.
- Use the provided scope to define the sequence of database operations to be included in the transaction.
Example: Consider an example where a series of database operations need to be executed within a transaction:
Start Transaction:
Connection: MySqlConnectionVariable
Delay: 0
... Perform database operations within the transaction ...
If Error Occurs:
Roll Back Transaction
Else:
Commit Transaction
In this example, the "Start Transaction" activity is used to initiate a transaction. The MySqlConnection variable, "MySqlConnectionVariable," is used to execute database operations within the transaction. If an error occurs, the transaction is rolled back; otherwise, it is committed, ensuring data integrity.
Start Transaction Scope
AutomatR.MySQLDataBase.Database.StartTransactionScope
The "Start Transaction Scope" activity in AutomatR serves as a container for defining a sequence of actions to be executed within a transaction. It works in conjunction with the "Start Transaction" activity to encapsulate the database operations that should be included in the transaction.
Properties
Name | Description |
---|---|
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Start Transaction" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
How to use:
- Drag and drop the "Start Transaction Scope" activity onto the workflow.
- Place the desired sequence of database activities within the "Start Transaction Scope."
- Ensure that the "Start Transaction" activity precedes the "Start Transaction Scope" to encapsulate the subsequent operations within a transaction.
Example: Consider the continuation of the previous example, where a sequence of database operations is included in the transaction:
Start Transaction:
Connection: MySqlConnectionVariable
Delay: 0
Start Transaction Scope:
... Perform database operations within the transaction ...
If Error Occurs:
Roll Back Transaction
Else:
Commit Transaction
In this example, the "Start Transaction Scope" activity contains the sequence of database operations to be executed within the transaction initiated by the "Start Transaction" activity. The transaction is committed if no errors occur; otherwise, it is rolled back to maintain data consistency.